package com.cosmocoder.monopoly.domain;

import java.util.HashSet;
import java.util.Set;

public class Room {
	Set<Player> players;
	String name;
	long id;
	
	public Theme theme;

	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}

	public Theme getTheme() {
		return theme;
	}
	public void setTheme(Theme theme) {
		this.theme = theme;
	}
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Set<Player> getPlayers() {
		if(players == null) players = new HashSet<Player>();
		return players;
	}

	public void setPlayers(Set<Player> players) {
		this.players = players;
	}
	
	public boolean equals (Room other) {
		return this.getId() == other.getId();
	}
	
	@Override
	public boolean equals(Object other) {
		if(other == null) return false;
		if(!(other instanceof Room)) return false;
		return equals((Room) other);
	}
	
	@Override
	public int hashCode() {
		return Long.valueOf(getId()).hashCode();
	}
}
